package com.villaday.idf.adapter3;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.villaday.idf.R;


import com.villaday.idf.base.AbsRecyclerViewAdapter;

public class OrderAdapter extends AbsRecyclerViewAdapter<String> {

    public OrderAdapter(Context context) {
        super(context, com.villaday.idf.R.layout.recycle_order_details);
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, String d, int position) {

        holder.bindTextView(R.id.tv_order_title, d);

        TextView tvOrderContent = (TextView) holder.getView(R.id.tv_order_content);

        switch (d) {
            case "已完成":
                tvOrderContent.setText("订单已完成");
                holder.bindImageView(R.id.iv_order_type, R.drawable.order_status_completed);
                break;
            case "已取消":
                tvOrderContent.setText("订单已取消，重新选择心仪的产品下单把");
                holder.bindImageView(R.id.iv_order_type, R.drawable.order_status_cancelled);
                break;
            case "退款中":
                tvOrderContent.setText("订单退款中，请耐心等候");
                holder.bindImageView(R.id.iv_order_type, R.drawable.order_status_refunding);
                break;
            case "已退款":
                tvOrderContent.setText("订单已退款");
                holder.bindImageView(R.id.iv_order_type, R.drawable.order_status_refunded);
                break;
            case "待支付":
                tvOrderContent.setText("产品库存随时变化，喜欢就尽快支付把");
                holder.getView(R.id.tv_order_right).setVisibility(View.VISIBLE);
                holder.bindImageView(R.id.iv_order_type, R.drawable.order_status_to_be_paid);
                break;
            case "确认中":
                tvOrderContent.setText("您的订单正在确认中，请耐心等候");
                holder.bindImageView(R.id.iv_order_type, R.drawable.order_status_confirming);
                break;
            case "待使用":
                tvOrderContent.setText("预订已成功，你可以放心使用");
                holder.bindImageView(R.id.iv_order_type, R.drawable.order_status_to_be_used);
                break;
            default:
        }
    }
}
